import SilverBullet from "./SilverBullet.js"

const _bulletsPool = new Array<SilverBullet>()
const _enemyPool = []

const Pool = {
  generateBullet():SilverBullet{
    let bullet = null
    if(_bulletsPool.length === 0){
      bullet = new SilverBullet(0,0)
    }else {
      bullet = _bulletsPool.shift() as SilverBullet
    }
    return bullet
  },
  recycleBullet(bullet:SilverBullet){
    _bulletsPool.push(bullet)
  }
}

// setInterval(()=>{
//   console.clear()
//   console.table(_bulletsPool)
// },1000)



export default Pool